home *** CD-ROM | disk | FTP | other *** search
/ Zoom 2 / Zoom - Release 2 (1996)(Active Software)[!].iso / programming / amos / amossible / spritesnbobs / bobcol3.amos / bobcol3.amosSourceCode < prev    next >
Encoding:
AMOS Source Code  |  1980-05-17  |  883 b   |  30 lines

  1. Rem In this Bob collisioon example we test between one Bob and its 
  2. Rem collision between another-As you may notice if you have a few
  3. Rem sprites/Bobs on screen at once,they might touch and start  
  4. Rem being uncontrolable-This is a more precise way of hecking for  
  5. Rem collisions-As you'll see,this only prints a message if Bob 1 
  6. Rem touches Bob 3. 
  7. Rem The start of the range of collisions and end of the range of 
  8. Rem collisions is the same Bob,so it effectively tests for a collision 
  9. Rem between Bob 1 and Bob 3. 
  10. Screen Open 0,320,256,16,Lowres
  11. Flash Off 
  12. Curs Off 
  13. Cls 0
  14. Load "ATTBG:JUMP.Abk"
  15. Get Sprite Palette 
  16. Double Buffer 
  17. X=150
  18. Y=110
  19. Bob 2,20,50,3
  20. Bob 3,190,50,3
  21. Bob 4,190,200,3
  22. Bob 5,20,200,2
  23. Do 
  24. If Joy(1)=1 Then Y=Y-1
  25. If Joy(1)=2 Then Y=Y+1
  26. If Joy(1)=4 Then X=X-1
  27. If Joy(1)=8 Then X=X+1
  28. If Bob Col(1,3 To 3) Then Print At(10,10);"COLLISION DETECTED"
  29. Bob 1,X,Y,1
  30. Loop